<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>系统设置</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  {include file="public/css"/}
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-card layui-col-md12">
		<div class="layui-card-header"><i class="fa fa-cog"></i> 系统设置</div>
		<div class="layui-card-body" pad15>
			<div class="layui-form" lay-filter="">
				点餐设置<hr/>
				<div class="layui-form-item">
					<label class="layui-form-label" style="width:130px">商品评价：</label>
					<div class="layui-input-inline">
						<input type="radio" name="info[shop_comment]" value="1" {if $info['shop_comment']==1}checked{/if} title="开启" lay-filter="shop_comment"/>
						<input type="radio" name="info[shop_comment]" value="0" {if $info['shop_comment']==0}checked{/if} title="关闭" lay-filter="shop_comment"/>
					</div>
				</div>
				<div class="layui-form-item" id="shop_commentset" {if $info['shop_comment']==0}style="display:none"{/if}>
					<label class="layui-form-label" style="width:130px">评价审核：</label>
					<div class="layui-input-inline">
						<input type="radio" name="info[shop_comment_check]" value="1" {if $info['shop_comment_check']==1}checked{/if} title="开启"/>
						<input type="radio" name="info[shop_comment_check]" value="0" {if $info['shop_comment_check']==0}checked{/if} title="关闭"/>
					</div>
					<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">关闭后用户的评价将直接显示,不需要后台审核</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label" style="width:130px">是否显示{:t('佣金')}：</label>
					<div class="layui-input-inline">
						<input type="radio" name="info[shop_showcommission]" value="1" {if $info['shop_showcommission']==1}checked{/if} title="显示"/>
						<input type="radio" name="info[shop_showcommission]" value="0" {if $info['shop_showcommission']==0}checked{/if} title="不显示"/>
					</div>
					<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">开启后商品详情页显示分销{:t('佣金')}</div>
				</div>

				外卖设置<hr/>
				<div class="layui-form-item">
					<label class="layui-form-label" style="width:130px">自动关闭订单：</label>
					<div class="layui-input-inline">
						<input type="text" name="info[takeaway_autoclose]" lay-verify="required" lay-verType="tips" class="layui-input" value="{$info.takeaway_autoclose}">
					</div>
					<div class="layui-form-mid">分钟</div>
					<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">下单后多久不支付自动关闭订单，释放占用的库存</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label" style="width:130px">商品评价：</label>
					<div class="layui-input-inline">
						<input type="radio" name="info[takeaway_comment]" value="1" {if $info['takeaway_comment']==1}checked{/if} title="开启" lay-filter="takeaway_comment"/>
						<input type="radio" name="info[takeaway_comment]" value="0" {if $info['takeaway_comment']==0}checked{/if} title="关闭" lay-filter="takeaway_comment"/>
					</div>
				</div>
				<div class="layui-form-item" id="takeaway_commentset" {if $info['takeaway_comment']==0}style="display:none"{/if}>
					<label class="layui-form-label" style="width:130px">评价审核：</label>
					<div class="layui-input-inline">
						<input type="radio" name="info[takeaway_comment_check]" value="1" {if $info['takeaway_comment_check']==1}checked{/if} title="开启" lay-filter="takeaway_comment_check"/>
						<input type="radio" name="info[takeaway_comment_check]" value="0" {if $info['takeaway_comment_check']==0}checked{/if} title="关闭" lay-filter="takeaway_comment_check"/>
					</div>
					<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">关闭后用户的评价将直接显示,不需要后台审核</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label" style="width:130px">是否显示{:t('佣金')}：</label>
					<div class="layui-input-inline">
						<input type="radio" name="info[takeaway_showcommission]" value="1" {if $info['takeaway_showcommission']==1}checked{/if} title="显示"/>
						<input type="radio" name="info[takeaway_showcommission]" value="0" {if $info['takeaway_showcommission']==0}checked{/if} title="不显示"/>
					</div>
					<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">开启后商品详情页显示分销{:t('佣金')}</div>
				</div>
				排队设置<hr/>
				<div class="layui-form-item">
					<label class="layui-form-label" style="width:130px">腾讯云APPID：</label>
					<div class="layui-input-inline">
						<input type="text" name="info[queue_appid]" lay-verType="tips" class="layui-input" value="{$info.queue_appid}">
					</div>
					<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">腾讯云开通语音合成功能，用于排队叫号，在账号信息中查找</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label" style="width:130px">腾讯云SecretID：</label>
					<div class="layui-input-inline" style="width:350px">
						<input type="text" name="info[queue_secretid]" lay-verType="tips" class="layui-input" value="{$info.queue_secretid}">
					</div>
					<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">在访问控制-访问密钥中查找</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label" style="width:130px">腾讯云SecretKEY：</label>
					<div class="layui-input-inline" style="width:350px">
						<input type="text" name="info[queue_secretkey]" lay-verType="tips" class="layui-input" value="{$info.queue_secretkey}">
					</div>
					<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">在访问控制-访问密钥中查找</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label" style="width:130px">声音类型：</label>
					<div class="layui-input-inline">
						<input type="text" name="info[queue_voicetype]" lay-verType="tips" class="layui-input" value="{$info.queue_voicetype}">
					</div>
					<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">VoiceType <a href="https://cloud.tencent.com/document/product/1073/34093" target="_blank">查看支持的声音类型</a></div>
				</div>
				
				<div class="layui-form-item">
					<div class="layui-input-block" style="margin-left:160px;">
						<button class="layui-btn" lay-submit lay-filter="formsubmit">提 交</button>
					</div>
				</div>
			</div>
		</div>
      </div>
    </div>
  </div>
	{include file="public/js"/}
	<script>
	//时间范围
	layui.use('laydate', function() {
		var laydate = layui.laydate;
		lay('.time-select').each(function(){
			laydate.render({
				elem: this
				,type: 'time'
				,range: true
			});
		});
	});

	layui.form.on('radio(shop_comment)', function(data){
		if(data.value == '1'){
			$('#shop_commentset').show();
		}else{
			$('#shop_commentset').hide();
		}
	})
	layui.form.on('radio(takeaway_comment)', function(data){
		if(data.value == '1'){
			$('#takeaway_commentset').show();
		}else{
			$('#takeaway_commentset').hide();
		}
	})
	layui.form.on('radio(wxpaytype)', function(data){
		if(data.value == '0'){
			$('#wxpaytype1set').hide();
			$('#wxpaytype0set').show();
		}else{
			$('#wxpaytype1set').show();
			$('#wxpaytype0set').hide();
		}
	})
	layui.form.on('radio(alipayset)', function(data){
		if(data.value == '0'){
			$('#alipayset').hide();
		}else{
			$('#alipayset').show();
		}
	})
	layui.form.on('radio(withdraw)', function(data){
		if(data.value == '1'){
			$('#withdrawotherset').show();
		}else{
			$('#withdrawotherset').hide();
		}
	})
	layui.form.on('radio(comwithdraw)', function(data){
		if(data.value == '1'){
			$('#comwithdrawotherset').show();
		}else{
			$('#comwithdrawotherset').hide();
		}
	})
	layui.form.on('submit(formsubmit)', function(obj){
		var field = obj.field

		//哪个选项卡 用于刷新后保持
		var tabindex = 0;
		$('.layui-tab-title>li').each(function(i,v){
			if($(this).hasClass('layui-this')){
				tabindex = i;
				console.log(i)
				return false;
			}
		})
		field.tabindex = tabindex;
		$.post('',field,function(data){
			dialog(data.msg,data.status,data.url);
		})
	})
  </script>

	
	{include file="public/copyright"/}
</body>
</html>